<template>
  <div class="top">
    <div class="total">
      全部商品<span>{{ all }}</span>
    </div>
    <div class="select">
      已选商品<span>{{ num }}</span
      >件
    </div>
    <div class="price">
      合计（不含运费）：<span>{{ price.toFixed(2) }}</span>
    </div>
    <div class="buy" @click="orderCreate">结算</div>
  </div>
</template>

<script>
export default {
  name: "top",
  props: {
    all: Number,
    num: Number,
    price: Number,
  },
  methods: {
    orderCreate() {
      this.$emit("orderCreate");
      // this.$router.push({ name: "OrderCreate" });
    },
  },
};
</script>

<style lang="scss" scoped>
.top {
  max-width: 1200px;
  margin: 0 auto;
  font-size: 16px;
  color: #333333;
  line-height: 22px;
  display: flex;
  align-items: center;
  .total {
    font-weight: 600;
    color: #dc2c1a;
    flex: 1;
    span {
      margin-left: 20px;
    }
  }
  .select {
    margin-right: 20px;
    span {
      color: #dc2c1a;
      padding: 0 6px;
    }
  }
  .price {
    span {
      color: #dc2c1a;
    }
  }
  .buy {
    margin-left: 20px;
    width: 90px;
    height: 40px;
    background: #d52c1a;
    border-radius: 5px;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 16px;
    color: #ffffff;
    cursor: pointer;
    &:hover {
      opacity: 0.8;
    }
  }
}
</style>
